import request from '@/utils/request'
import data from '@/views/pdf/content'
import { AxiosPromise } from 'axios'
interface HttpResult {
  message: string
  data: any
  code: number
}

export function getAction(params: any, url: String) {
  return request({
    url: '/api/' + url,
    method: 'get',
    params
  })
}

export function getLongTimeAction(params: any, url: String) {
  return request({
    url: '/api/' + url,
    method: 'get',
    params,
    timeout: 0
  })
}

export function postLongTimeAction(data: any, url: String) {
  return request({
    url: '/api/' + url,
    method: 'post',
    data,
    timeout: 0
  })
}

export function postAction(params: any, url: String) {
  return request({
    url: '/api/' + url,
    method: 'post',
    data: params
  })
}

export function postParamsAction(params: any,data:any, url: String) {
  debugger
  return request({
    url: '/api/' + url,
    method: 'post',
    params:params,
    data: data
  })
}

export function deleteAction(params: any, url: String) : HttpResult {
  // @ts-ignore
  return request({
    url: '/api/' + url,
    method: 'delete',
    data: params
  })
}

export function getUrlAction(params: any, url: any) {
  return request({
    url: url,
    method: 'get',
    params
  })
}

export function postUrlAction(params: any, url: any) {
  return request({
    url: url,
    method: 'post',
    params
  })
}
